<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        /* 
            假如投资的年利率是5%，从1000快涨到5000块，需要多少年？
         */
         var money=1000;
         //定义一个计数器
         var count=0;
         while(money<5000){
             money*=1.05
             count++;
         }
         console.log(count);
    </script>
</head>
<body>
    
</body>
</html>